package com.xrit.sunnyday.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xrit.sunnyday.dao.LoginMobileDao;
import com.xrit.sunnyday.dao.MemberDao;
import com.xrit.sunnyday.pojo.Member;
import com.xrit.sunnyday.pojo.Order;
import com.xrit.sunnyday.service.LoginMobileService;
import org.aspectj.weaver.ast.Or;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.HashMap;

/**
 * 类名称: LoginMobileServiceImpl
 * 类描述:TODO
 * 创建人: czb
 * 创建时间:2022/7/1 上午 11:57
 * Version 1.0.0
 */
@Service(interfaceClass = LoginMobileService.class)
public class LoginMobileServiceImpl implements LoginMobileService {
    @Autowired
   private MemberDao memberDao;

    @Override
    public void addMember(HashMap<String, String> loginInfo) {
        String telephone = loginInfo.get("telephone");
        Member ObInMember = memberDao.findByTelePhone(telephone);
        if (null==ObInMember){
            //添加会员
            Member member = new Member();
            member.setRegTime(new Date());
            member.setPhoneNumber(telephone);
            memberDao.add(member);
        }
    }
}
